package com.tuozixuan.redisson.model;

import org.redisson.api.annotation.REntity;
import org.redisson.api.annotation.RId;
import org.redisson.api.annotation.RIndex;

@REntity
public class Person /* implements RLiveObject */ {

	@RId
	private Long id;
	
	@RIndex
	private String name;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (other == null || getClass() != other.getClass()) {
            return false;
        }
        
        Person localOther = (Person) other;
        boolean sameId = false;
        if ((this.id == null && localOther.getId() == null) || (this.id != null && this.id.equals(localOther.getId()))) {
        	sameId = true;
        }
        boolean sameSame = false;
        if ((this.name == null && localOther.getName() == null) || (this.name != null && this.name.equals(localOther.getName()))) {
        	sameSame = true;
        }
        return sameId && sameSame;
    }


	
}
